{extend name="base" /}
{block name="js"}
<script src="__ADMIN__/orders/orders.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}
<div style='margin:10px;'>
  <div class='order-box'>
    <div class='box-head'>日志信息</div>
    {if in_array($object['orderStatus'],[-2,0,1,2])}
      <div class='log-box'>
      <div class="state">
      {if $object['payType']==1}
        <div class="icon">
        	<span class="icons {if condition="($object['orderStatus']==-2)OR($object['orderStatus']==0)OR($object['orderStatus']==1)OR($object['orderStatus']==2)"}icon12 {else}icon11 {/if}{if condition="($object['orderStatus']==-2)"}icon13 {/if}"></span>
        </div>
        <div class="arrow {if condition="($object['orderStatus']==0) OR ($object['orderStatus']==1) OR ($object['orderStatus']==2)"}arrow2{/if}">··················></div>
        	<div class="icon"><span class="icons {if condition="($object['orderStatus']==0)OR($object['orderStatus']==1)OR($object['orderStatus']==2)"}icon22 {else}icon21{/if}{if condition="($object['orderStatus']==0)"}icon23 {/if}"></span></div>
        	<div class="arrow {if condition="($object['orderStatus']==1) OR ($object['orderStatus']==2)"}arrow2{/if}">··················></div>
      {else}
        <div class="icon">
        	<span class="icons {if condition="($object['orderStatus']==-2)OR($object['orderStatus']==0)OR($object['orderStatus']==1)OR($object['orderStatus']==2)"}icon12 {else}icon11 {/if}{if condition="($object['orderStatus']==0)"}icon13 {/if}"></span>
        </div>
        <div class="arrow {if condition="($object['orderStatus']==1) OR ($object['orderStatus']==2)"}arrow2{/if}">··················></div>
      {/if}
      <div class="icon">
      	<span class="icons {if condition="($object['orderStatus']==1)OR($object['orderStatus']==2)OR($object['orderStatus']==1)"}icon32 {else}icon31 {/if}{if condition="($object['orderStatus']==1)"}icon33 {/if}"></span>
      </div>
      <div class="arrow {if condition="($object['orderStatus']==2)"}arrow2{/if}">··················></div>
      <div class="icon"><span class="icons  {if condition="($object['orderStatus']==2)AND($object['isAppraise']==1)"}icon42 {else}icon41 {/if}{if condition="($object['orderStatus']==2)AND($object['isAppraise']==0)"}icon43 {/if}"></span></div>
      <div class="arrow {if condition="($object['isAppraise']==1)"}arrow2{/if}">··················></div>
      <div class="icon"><span class="icons {if condition="($object['isAppraise']==1)"}icon53 {else}icon51 {/if}"></span></div>
      </div>
         <div class="state2">
         <div class="path">
         {volist name="$object['log']" id="lo"}
         	<span>{$lo['logContent']}<br/>{$lo['logTime']}</span>
         {/volist}
         </div>
         <p>下单</p>{if $object['payType']==1}<p>等待支付</p>{/if}<p>商家发货</p><p>确认收货</p><p>订单结束<br/>双方互评</p>
         </div>
         <div class="wst-clear"></div>
         </div>
    {else}
        <div class="odcont">
          <table class='log'>
            {volist name='$object["log"]' id='vo'}
             <tr>
               <td>{$vo['logTime']}</td>
               <td>{$vo['logContent']}</td>
             </tr>
            {/volist}
          </table>
        </div>                 
    {/if}
   </div>
   <div style='width:100%;padding-bottom:30px;height:auto;'>
     <div style='width:300px;float:left;'>
       <div style='width:100%;min-height:300px;height:auto;' class='order-box'>
           <div style='background:#eee;width:100%' class='box-head'>订单信息</div>
           <ul style='width:100%'>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>订单编号：</span>{$object['orderNo']}</li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>商品金额：</span>{$object['goodsMoney']}</li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：</span>{$object['deliverMoney']}</li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>订单金额：</span>{$object['totalMoney']}</li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>实付总金额：¥<span>{$object['realTotalMoney']}</li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>下单时间：</span></li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>支付方式：</span>{:WSTLangPayType($object['payType'])}</li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>配送方式：</span>{:WSTLangDeliverType($object['deliverType'])}</li>
              <li style='height:30px;line-height: 30px;padding-left:10px;'><span>商&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;家：</span></li>
           </ul>
       </div>
       <div style='width:100%;min-height:300px;height:auto;' class='order-box'>
           <div style='background:#eee;width:100%' class='box-head'>订单商品</div>
           <div style='width:100%;padding:5px;'>
           {volist name='$object["goods"]' id='vo2'}
           <a href='{:Url("home/goods/detail","goodsId=".$vo2["goodsId"])}' target='_blank'>
              <img src='__RESOURCE_PATH__/{$vo2["goodsImg"]}' width='80' height='80' title='{$vo2["goodsName"]|WSTStripTags}'/>
           </a>
           {/volist}
           </div>
       </div>
     </div>
     <div style='width:calc(100% - 310px);min-height:622px;height:auto;float:left;margin-left:10px;' class='order-box force-order-r'>
        <div style='background:#eee;width:100%' class='box-head'>订单状态</div>
        <table class='wst-form'>
           <tr>
              <th width='150'>变更状态：</td>
              <td class='layui-form'>
                {/**待支付的订单**/}
                {if $object['orderStatus']==-2}
                  <label><input type='radio' name='orderStatus' lay-filter="orderStatus" value='0' title='订单已支付【系统只是标记状态，不会有实际的扣款行为】'></label>
                {/if}
                {/**待支付的订单、等待发货的订单**/}
                {if in_array($object['orderStatus'],[-2,0])}
                  <label><input type='radio' name='orderStatus' lay-filter="orderStatus" value='-1' title='取消订单【取消订单，所支付的金额和积分原路返回】'></label>
                {/if}
                {/**待发货的订单、拒收的订单、确认收货的订单**/}
                {if in_array($object['orderStatus'],[1,-3,2])}
                  <!-- label><input type='radio' name='orderStatus' lay-filter="orderStatus" value='-3' title='拒收订单'></label -->
                  <label><input type='radio' name='orderStatus' lay-filter="orderStatus" value='2' title='确认收货'></label>
                {/if}
              </td>
           </tr>

           {/**将未支付公司称已支付**/}
           <tr class='result_0' style='display: none'>
              <th width='120'>支付方式<font color='red'>*</font>：</th>
              <td>
                  <select id="payFrom_0">
                    <option value="-1">请选择支付方式</option>
                    {volist name="payMents" id="pays"}
                    {if $pays.payCode!='wallets'}
                    <option value="{$pays.payCode}">{$pays.payName}</option>
                    {/if}
                    {/volist}
                  </select>
              </td>
            </tr>
            <tr class='result_0' id='otherPay_0' style='display: none'>
                <th>外部流水号<font color='red'>*</font>：</th>
                <td><input type="text" id="trade_no_0" autocomplete="false" style='width:60%'></td>
            </tr>

            {/**取消订单**/}
            <tr class='result_-1' style='display: none'>
                <th width='120'>退回金额：</th>
                <td>
                    {if ($object['payType']==1 && $object['isPay']==1)}
                    <input type="text" id="realTotalMoney_0" autocomplete="false" style='width:150px;margin-right:10px;'><font color='red'>(实付金额￥{$object['realTotalMoney']})</font>
                    {else}
                    ￥0
                    {/if}
                </td>
            </tr>
            <tr class='result_-1' style='display: none'>
                <th width='120'>退回积分：</th>
                <td>{if ($object['useScore']>0)}{$object['useScore']}{else}0{/if}</td>
            </tr>
           <tr>
              <td colspan="2" align="center" style='text-align:center;'>
                  <button type="button" onclick='javascript:changeOrder({$object['orderId']},{$p})' class='btn btn-primary btn-mright'><i class="fa fa-check"></i>确定更改</button>
                  <button type="button" onclick="javascript:location.href='{:Url(\'admin/orders/index\',\'p=\'.$p)}'" class='btn'><i class="fa fa-angle-double-left"></i>返回</button>
              </td>
           </tr>
        </table>
     </div>
     <div style='clear:both;'></div>
  </div>
<div>
<script>$(function(){initChange();})</script>
{/block}
